<script src="/statics/js/layer.js"></script>
<a href="javascript:void(0)" class="<?=$level ? 'putSubmit' : 'cd-popup-trigger2'?>" id="level" >
	<img src='/statics/img/level<?=$level?>.jpg' style="width:100%" />
</a>

<div class="cd-popup2" role="alert">
    <div class="cd-popup-container2">
        <div id="PopupLayer2" class="PopupLayer2"><a class="close cd-popup-close2"></a>
            <div class="xd-xzdz2"><span>升级黄金会员  ￥<?=getSysconfig('levelhPrice')?>：</span><a class="dingdan-list-order2-f" href="javascript:void(0)" id="shj" style="line-height: 42px;margin-left: 30px;">立即支付</a></div>
            <div class="xd-xzdz2"><span>升级白金会员  ￥<?=getSysconfig('levelbPrice')?>：</span><a class="dingdan-list-order2-f" href="javascript:void(0)" id="sbj" style="line-height: 42px;margin-left: 22px;">立即支付</a></div>
        </div>
    </div>
</div>

<script>
$(function(){
	<?php if($level == '1'){?>
	$('.putSubmit').click(function(){
		$.post('/saler/inlevel',{'level':'<?=$level?>','dosubmit':'1','sek':'<?=$sek?>'},function(data){
			if(data.code == '1'){
				layer.msg('正在跳转支付页..', {icon: 1});
				setTimeout(function(){window.location = '/order/pay/?orderId='+data.data;},1000);
			}else{
				alert(data.msg);
			}
		},'json');
	});
	<?php }else if($level == '0'){?>
		$('#shj').click(function(){
			$.post('/saler/inlevel',{'dosubmit':'1','type':'1','sek':'<?=$sek?>'},function(data){
				if(data.code == '1'){
					layer.msg('正在跳转支付页..', {icon: 1});
					setTimeout(function(){window.location = '/order/pay/?orderId='+data.data;},1000);
				}else{
					alert(data.msg);
				}
			},'json');
		});
		$('#sbj').click(function(){
			$.post('/saler/inlevel',{'dosubmit':'1','type':'2','sek':'<?=$sek?>'},function(data){
				if(data.code == '1'){
					layer.msg('正在跳转支付页..', {icon: 1});
					setTimeout(function(){window.location = '/order/pay/?orderId='+data.data;},1000);
				}else{
					alert(data.msg);
				}
			},'json');
		});
	<?php }?>
})
</script>